<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			var s = "窗前明月光，疑是地上霜";
			var length = s.length;
			alert(length);
			var sindex = s.indexOf("光");
			alert(sindex);
			var sinstr = s.substring(2, 4);
			alert(sinstr);
		</script>
	</body>
</html>